package com.hex.liyue.usermodule.presenter;

import com.hex.liyue.commonmodule.manager.HttpManager;
import com.hex.liyue.commonmodule.manager.UserManager;
import com.hex.liyue.commonmodule.net.ResponseListener;
import com.hex.liyue.usermodule.bean.MyOrderResultBean;

/**
 * Created by WJ on 2016/6/29.
 */
public class MyOrderPresenter {
    private IMyOrderView iMyOrderView;

    public MyOrderPresenter(IMyOrderView iMyOrderView) {
        this.iMyOrderView = iMyOrderView;
    }

    public void orderList(int page, int pagenum) {
        iMyOrderView.showLod("加载中...");
        HttpManager.getInstance().orders_orderList(UserManager.getUserId(), page, pagenum, new ResponseListener<MyOrderResultBean>() {
            @Override
            public void onSuccess(MyOrderResultBean myOrderResultBean) {
                iMyOrderView.closeLod();
                iMyOrderView.setAdapter(myOrderResultBean);
            }

            @Override
            public void onFailure(String responseresult) {
                iMyOrderView.closeLod();
                iMyOrderView.showT(responseresult);
            }
        });
    }
}
